import request from "@/utils/request";

class StudentActivityHistoryAPI {

  static getPage(pageNum: number, pageSize: number, studentName?: string, activityName?: string) {
    return request.post('/api/activity-history/page', {
      pageNum,
      pageSize,
      studentName,
      activityName,
    });
  }

   static deleteRecord(id: number) {
    return request.delete(`/api/activity-history/delete/${id}`);
  }
  /**
   * 获取所有学生的活动报名记录
   *
   * @returns Promise<any>
   */
  static getAllHistories() {
    return request<any, any>({
      url: "/api/activity-history/all",
      method: "post",
    });
  }

  /**
   * 根据 studentId 查询学生活动记录
   *
   * @param studentId 学生ID
   * @returns Promise<any>
   */
  static getHistoryByStudentId(studentId: number | string) {
    return request<any, any>({
      url: "/api/activity-history/student",
      method: "post",
      data: {
        studentId,
      },
    });
  }
}

export default StudentActivityHistoryAPI;
